package advance.codec;

public class Base64Test {
    public static void main(String[] args) {
        Base64 base64 = new Base64();
        String s = "yangdj";
        byte[] bytes = s.getBytes();
        for (int i = 0; i < bytes.length; i++) {
            System.out.println(bytes[i]);
        }
        System.out.println(String.valueOf(bytes));
        System.out.println("========");
        byte[] bytes1 = base64.encodeBase64(bytes);
        for (int i = 0; i < bytes1.length; i++) {
            System.out.println(bytes1[i]);
        }
        System.out.println(String.valueOf(bytes1));
        System.out.println("========");
        byte[] bytes2 = base64.decodeBase64(bytes1);
        for (int i = 0; i < bytes2.length; i++) {
            System.out.println(bytes2[i]);
        }
        System.out.println(String.valueOf(bytes2));
    }
}
